package com.gxa.meiye.admin.platform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gxa.meiye.admin.platform.pojo.domain.Shop;
import com.gxa.meiye.admin.platform.pojo.vo.SettleVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SettleMapper extends BaseMapper<SettleVo> {

    @Select("SELECT `id`, `name`, `location`, `email`, `responsible_person`, `responsible_person_phone`,`registration_time`\n" +
            "FROM t_shop\n" +
            "WHERE audit_status = 0")
    List<SettleVo> selectSettleList();

    @Update("UPDATE `t_shop` SET `audit_status` = #{audit_status} WHERE `id` = #{id}")
    void audit(Integer id, Integer audit_status);

    @Select("SELECT * FROM `t_shop` WHERE id=#{id}")
    Shop selectById(Integer id);
}
